import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.*;

public class javaProjectTest {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testFibonacci() {
		int vec =  6;
		ArrayList<Integer> actuals = javaProject.fibonacci(vec);
		ArrayList<Integer> expecteds = new ArrayList<Integer>();
		expecteds.add(0);
		expecteds.add(1);
		expecteds.add(1);
		expecteds.add(2);
		expecteds.add(3);
		expecteds.add(5);
		assertArrayEquals(expecteds.toArray(), actuals.toArray());
	}

	@Test
	public void testFactorial() {
		
		int vec =  5;
		int num = javaProject.factorial(vec);
		assertTrue(num == 120);
		
	}

	@Test
	public void testSqrtsum() {
		
	// write sample code to test your methods.
		// in this case i know that when i enter 4 the square root function will return 30
		// thus i write code and determine values to check for it.
		
		int vec =  4;
		int num = javaProject.sqrtsum(vec);
		assertTrue(num == 30);
	
	}

	@Test
	public void testNegexpsum() {
		
		int vec =  5;
		double num = javaProject.negexpsum(vec);
		assertTrue(num == 2.283333333333333 );
		
		
	}

	@Test
	public void testCubes() {
		int vec =  6;
		int num = javaProject.cubes(vec);
		assertTrue(num == 441);
	}

	@Test
	public void testSumOfEquallyFarProducts() {
		
		int vec =  5;
		double num = javaProject.sumOfEquallyFarProducts(vec);
		assertTrue(num == 13.0 );
		
		
		
	}

	@Test
	public void testMultiplesOfThree() {
		

	     
	    int vec =  15;
	

		//Check whether two arrays are equal to each other.
	      
	      ArrayList<Integer> actuals = javaProject.multiplesOfThree(vec);
			ArrayList<Integer> expecteds = new ArrayList<Integer>();
			expecteds.add(0);
			expecteds.add(3);
			expecteds.add(6);
			expecteds.add(9);
			expecteds.add(12);
			expecteds.add(15);
			assertArrayEquals(expecteds.toArray(), actuals.toArray());
					
	      
	}

	@Test
	public void testGeometricMean() {
		
		int vec =  15;
		double num = javaProject.geometricMean(vec);
		assertTrue(num == 4.169951397444989 );
			
		
	}

	@Test
	public void testPrimes() {
		
		
		
		 int vec =  15;
		

		//Check whether two arrays are equal to each other.
	      
	      ArrayList<Integer> actuals = javaProject.primes(vec);
			ArrayList<Integer> expecteds = new ArrayList<Integer>();
			expecteds.add(2);
			expecteds.add(3);
			expecteds.add(5);
			expecteds.add(7);
			expecteds.add(11);
			expecteds.add(13);
			assertArrayEquals(expecteds.toArray(), actuals.toArray());
			
	}

	

}
